package com.example.demo0317.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class House {
    private final AirConditioner airConditioner;
    private final TV tv;

    @Autowired
    public House(AirConditioner airConditioner, TV tv) {
        this.airConditioner = airConditioner;
        this.tv = tv;
    }

    public void openDoor() {
        System.out.println("House door is opened.");
        airConditioner.cool(36);
        tv.play("Welcome to our house!");
    }
}
